<template>
 <div>
     <h3 class="m-center">我的订单</h3>
     <div v-for="item in list" :key="item.orderNo" @click="toOrderDetail(item.orderNo)">
         <van-grid direction="horizontal" :column-num="3" >
             <van-grid-item  text="订单编号" />
             <van-grid-item  :text="item.orderNo" />
             <van-grid-item  :text="item.createTime" />
         </van-grid>
     </div>

 </div>
</template>

<script>
    import {orderList} from "../../utils/apis";

    export default {
        name: "Order",
        data(){
            return{
                list:[]
            }
        },
        created() {
            this.getData()
        },
        methods:{
            getData(){
                orderList({
                    pageSize:100,
                    pageNum:1
                }).then(res => {
                    console.log(res)
                    this.list = res.data.list
                })
            },
            toOrderDetail(orderNo){
                console.log(orderNo)
                this.$router.push({name:"OrderDetail",query:{orderNo:orderNo}})
            }
        }
    }
</script>

<style scoped>
.m-center{
    text-align: center;
}
</style>
